package practice.fourth.controller;


import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author :Colin
 * @version 创建时间: 2021/9/10 20:01
 */
@RestController
public class ProviderController {
    @Value("${server.port:8080}")
    private String port;//value注解不能用于局部变量,所以要写成成员变量
    @GetMapping("/provider/{msg}")
    public String doGetMsg(@PathVariable String msg){
        String info=msg+" , port is "+port;
        System.out.println(info);
        return info;
    }
}
